package com.sskj.cndragon.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.cndragon.bean.OrderPositionListBean;
import com.sskj.cndragon.bean.OrderSellListBean;
import com.sskj.cndragon.ui.fragment.SellOutFragment;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonConverter;

import java.util.List;

import io.reactivex.Flowable;


public class SellOutFragmentPresenter extends BasePresenter<SellOutFragment> {

    public Flowable<List<OrderSellListBean.OrderSellBean>> getOrderSellRecord(String userID, int page) {
        return httpService.getOrderSellRecord(userID, page)
                .tag(this)
                .converter(new JsonConverter<HttpData<OrderSellListBean>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getList());
    }
}
